package com.wm.blog_web.feign.fallback;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wm.blog_common.result.Result;
import com.wm.blog_config.Document.BlogDocument;
import com.wm.blog_web.feign.SearchFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 搜索服务
 *
 * @author wm_yu
 * @date 2019/04/02
 */
@Slf4j
@Component
public class SearchClientFallbackImpl implements SearchFeignClient {


    private Throwable throwable;

    public Throwable getThrowable() {
        return throwable;
    }

    public void setThrowable(Throwable throwable) {
        this.throwable = throwable;
    }

    @Override
    public Result add(BlogDocument blogDocument) {
        return Result.failure();
    }

    @Override
    public Result delete(Long id) {
        return Result.failure();
    }

    @Override
    public Result deleteAll() {
        return Result.failure();
    }

    @Override
    public Result<BlogDocument> getById(Long id) {
        return Result.failure();
    }

    @Override
    public Result<List<BlogDocument>> getAll() {
        return Result.failure();
    }

    @Override
    public Result<List<BlogDocument>> query(String keyword) {
        return Result.failure();
    }

    @Override
    public Result<List<Map<String, Object>>> queryHit(String keyword, String indexName, String fields) {
        return Result.failure();
    }

    @Override
    public Result<Page<Map<String, Object>>> queryHitByPage(int current, int size, String keyword, String indexName, String fields) {
        return Result.failure();
    }

    @Override
    public Result<String> deleteIndex(String indexName) {
        return Result.failure();
    }

    @Override
    public Result updateDocument(BlogDocument document) {
        return Result.failure();
    }
}
